package com.example.shopping_mall.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.IdRes;
import androidx.fragment.app.Fragment;

import com.example.shopping_mall.http.ShoppingInterface;
import com.example.shopping_mall.utils.ShoppingUtils;

/**
 * @ProjectName: hospital
 * @Package: com.itmi.hospital.fragment
 * @ClassName: AllFragment
 * @Description: java类作用描述
 * @Author: 作者名
 * @CreateDate: 2022-09-30 13:19
 * @UpdateUser: 更新者：
 **/
public abstract class AllFragment extends Fragment {

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(getLayoutId(), null, false);
    }

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        initView();
    }

    protected <T extends View> T findViewById(@IdRes int resId) {
        return getView().findViewById(resId);
    }

    protected abstract void initView();

    protected abstract int getLayoutId();
}
